<div class="item service-box">
    <div class="billing-module">
        <div class="module-title">云服务器名称</div>
        <div class="item-content">
            <div class="item-line">
                <input type="text" required name="instance_name" class="form-control w300" placeholder="请输入云服务器名称">
            </div>
        </div>
    </div>
    <div class="billing-module">
        <div class="module-title">用户名</div>
        <div class="user">{{ projects }}</div>
    </div>
    <div class="billing-module">
        <div class="module-title">密码</div>
        <div class="item-content">
            <div class="errnotice-box">
                <div class="form-group has-error">
                    <input type="text" required class="form-control w300" id="password" name="password",placeholder="请输入密码">
                </div>
            </div>
        </div>
    </div>
    <div class="billing-module">
        <div class="module-title">确认密码</div>
        <div class="item-content">
            <div class="errnotice-box">
                <div class="form-group">
                    <input type="text" required  class="form-control w300" id="confirmpassword"  name="confirmpassword" placeholder="请再次输入密码">
                </div>
                <div class="errnotice" id="err">
                    <div class="single-line">
                        <img src="{{ STATIC_URL }}ratingfunction/img/error.png" alt="">
                        <span class="ml10">密码和确认密码必须相同</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    var password = document.getElementById("password")
    var confirmpassword = document.getElementById("confirmpassword")

    var err = document.getElementById("err")
    var errs = null
    var iserr = true
    confirmpassword.onblur = function () {
        if (password.value !== confirmpassword.value) {
            err.getAttributeNode("class").value = "errnotice active"
            errs = setInterval(function () {
                err.getAttributeNode("class").value = "errnotice"
                clearInterval(errs)
                isess = false
            }, 5000)

        } else {
            iserr = false
        }
    }

</script>
